package com.rwind.schema;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration;
import org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration;
import org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.Bean;

import java.util.Collections;

@SpringBootApplication(scanBasePackages = {"com.rwind.schema.controller", "com.rwind.schema.config", "com.rwind.schema.service"},
        exclude = {DataSourceAutoConfiguration.class, JmxAutoConfiguration.class, ThymeleafAutoConfiguration.class/*,
                DispatcherServletAutoConfiguration.class*/})
public class AppMain   {
    public static void main(String[] args) {
        SpringApplication application = new SpringApplication(AppMain.class);
        application.setWebApplicationType(WebApplicationType.NONE);
        application.run(args);
    }


    /*
    @Bean
    public ServletRegistrationBean servletRegistrationBean(final DispatcherServlet dispatcherServlet) {
        final ServletRegistrationBean servletRegistrationBean = new ServletRegistrationBean(dispatcherServlet);
        servletRegistrationBean.setEnabled(false);
        return servletRegistrationBean;
    }
     */
}
